﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WpfWordsLearner.Converters
{
	public class BoolReverseConverter : System.Windows.Data.IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			if (value != null && value is bool)
				return !(bool)value;

			if (value == null)
				return System.Windows.DependencyProperty.UnsetValue;

			return value;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			return !(bool)value;
		}
	}
}
